package com.llu.jackson.study;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.llu.jackson.study.bean.HealthWorker;

import java.io.IOException;

public class MyJackson extends JsonSerializer<HealthWorker> {
    @Override
    public void serialize(HealthWorker value, JsonGenerator gen, SerializerProvider provider) throws IOException, JsonProcessingException {
        // 在此处实现您的序列化逻辑
        gen.writeString(value.toString());
    }
}
